package com.hanamaki.oop.demo13;

public class Test {

    public static void main(String[] args) throws Exception {

        int a = 1;
        int b = 0;

        // 假设想要捕获异常   可以从小到大 开始捕获
        try {

            if (b == 0) {
                // 主动抛出异常 程序会停止

            }

            int result = a / b;

        } catch (ArithmeticException e) {
            System.out.println(e.getMessage());
        }finally {


        }

    }
}
